package me.albert.entitylimiter.utils;

import java.util.Arrays;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class ItemUtil {
    public static ItemStack make(final ItemStack is, final String name, final String... lore) {
        final ItemMeta meta = is.getItemMeta();
        meta.setDisplayName(name);
        meta.setLore(Arrays.asList(lore));
        is.setItemMeta(meta);
        return is;
    }

    public static ItemStack make(final Material material, final String name, final String... lore) {
        final ItemStack is = new ItemStack(material);
        final ItemMeta meta = is.getItemMeta();
        meta.setDisplayName(name);
        meta.setLore(Arrays.asList(lore));
        is.setItemMeta(meta);
        return is;
    }

    public static ItemStack make(final Material material, final String name, final List<String> lore) {
        final ItemStack is = new ItemStack(material);
        final ItemMeta meta = is.getItemMeta();
        meta.setDisplayName(name);
        meta.setLore(lore);
        is.setItemMeta(meta);
        return is;
    }

    public static ItemStack make(final ItemStack is, final String name, final List<String> lore) {
        final ItemMeta meta = is.getItemMeta();
        meta.setDisplayName(name);
        meta.setLore(lore);
        is.setItemMeta(meta);
        return is;
    }
}
